package session;

import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ActionContext;
import java.util.Map;
//import action.Login.loginAction;

public class SessionManager extends ActionSupport implements SessionAware{

//	loginAction login = new loginAction();
//	
//	private Map<String, String> session = login.getSession();
//	private String loginId = login.getUserId();
//	private String sessionTime = login.getSessionTime();

	private Map<String, String> session;
	private String loginId;
	private String sessionTime;
	
	
	public String create_session(){
//	public String execute() throws Exception{
//		session = ActionContext.getContext().getSession();
//		loginId = session.get("userId");
//		sessionTime = session.get("sessionTime");
		
		session = ActionContext.getContext().getSession();
		loginId = session.get("user_id");
		sessionTime = session.get("sessionTime");
		
		System.out.println("loginId ====================================> "+loginId);
		System.out.println("sessionTime ==========세션메니져==============> "+sessionTime);
        
		return SUCCESS;
	}

	public void setSession(Map session){
		session = this.getSession();
	}

	public Map getSession(){
		return session;
	}

	public String getSessionTime() {
		return sessionTime;
	}

	public void setSessionTime(String sessionTime) {
		this.sessionTime = sessionTime;
	}

	public String getLoginId() {
		return loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	
} 